package com.smartscreen.baseinfomanage.client;

import com.smartscreen.baseinfomanage.dto.StudentInfoDTO;
import com.smartscreen.common.response.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(name = "base-info-manage", url = "${base-info.service.url:http://localhost:8080}")
public interface BaseInfoClient {
    
    @PostMapping("/api/base/subjects/batch")
    Map<String, Map<String, Object>> getSubjectsBatch(@RequestBody List<String> subjectIds);
    
    @PostMapping("/api/base/teachers/batch")
    Map<String, Map<String, Object>> getTeachersBatch(@RequestBody List<String> teacherIds);
    
    @PostMapping("/api/base/classes/batch")
    Map<String, Map<String, Object>> getClassesBatch(@RequestBody List<String> classIds);
    
    @PostMapping("/api/base/venues/batch")
    Map<String, Map<String, Object>> getVenuesBatch(@RequestBody List<String> venueIds);
    
    @PostMapping("/api/base/students/batch")
    Map<String, Map<String, Object>> getStudentsBatch(@RequestBody List<String> studentIds);
    
    @GetMapping("/api/base/classes/{classId}/students/ids")
    ApiResponse<List<String>> getStudentIdsByClassId(@PathVariable("classId") String classId);
    
    // 新增：根据学号批量获取学生信息
    @PostMapping("/api/base/students/by-numbers")
    List<StudentInfoDTO> getStudentsByNumbers(@RequestBody List<String> studentNumbers);
}